package Thread_Demo;public class demo8 {    public static void main(String[] args) {        Object lock1 = new Object();        //哲学家1申请锁1和锁2        Thread t1 = new Thread(()->{            while (true) {                synchronized (lock1) {                    System.out.println("哲学家1申请锁1");                    synchronized (lock1) {                        System.out.println("哲学家1申请锁1");                    }                }            }        });        t1.start();        try {            t1.join();        } catch (InterruptedException e) {            e.printStackTrace();        }    }}